package cn.itsource.shiro.utils;

import com.hazelcast.util.MD5Util;
import org.apache.shiro.crypto.hash.SimpleHash;

/**
 * @author xjh
 * @date 2020/3/29 23:49
 */
public class MyMD5Util {
    //盐值
    public static final String SALT = "itsource";

    /**
     * @Description: 保存用户时加密密码
      * @param pwd 明文密码
     * @return 
     * @throws 
     * @author xjh
     * @date  
    */
    public static String encrypt(String pwd){
        SimpleHash simpleHash = new SimpleHash("MD5", pwd, SALT, 10);
        return simpleHash.toString();
    }

    /*测试用*/
    public static void main(String[] args) {
        System.out.println(MyMD5Util.encrypt("1"));
    }
}